package com.hotelcrs.hotelcrsapi.controller;

import com.hotelcrs.hotelcrsapi.pojo.HotelRole;
import com.hotelcrs.hotelcrsapi.pojo.ResponseMessage;
import com.hotelcrs.hotelcrsapi.service.IHotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController //接口方法返回对象 转换成json文本
@RequestMapping("/api")
public class HotelController {
    @Autowired
    private IHotelService hotelService;

    @GetMapping("Role/List")//URL:localhost:8088/user/  method:get
    public List<HotelRole> getAll()
    {
        List<HotelRole> users=hotelService.getAllRole();
        //ResponseMessage.success(users);
        return users;
    }
}
